package queue;

/**
 * @description:
 * @author: caoyihong
 * @date: 2025-10-11 16:52
 * @Version 1.0
 **/
public class MaxSlidingWindow {
    public int[] maxSlidingWindow(int[] nums, int k) {
        int[] result = new int[nums.length-k+1];
        for (int i = 0; i < (nums.length-k+1); i++) {
            int max = nums[i];
            for (int j=i; j<i+k; j++) {
                if (max < nums[j]) {
                    max = nums[j];
                }
            }
            result[i] = max;
        }
        return result;
    }
}
